package com.jxc.jxc01.yk.service;

;

import com.jxc.jxc01.yk.dao.ISalesDao;
import com.jxc.jxc01.yk.dao.SalesDaoImpl;
import com.jxc.jxc01.yk.entity.PageHelper;
import com.jxc.jxc01.yk.entity.RespResult;
import com.jxc.jxc01.yk.entity.Sales;

import java.util.List;

public class SalesServiceImpl implements ISalesService {
    ISalesDao salesDao = new SalesDaoImpl();

    /**
     * 增加销售清单
     */
    public boolean addSales(List<Sales> sales){
        return  salesDao.addSales(sales);
    }

    /**
     *查询销售清单
     */
    @Override
    public  PageHelper<Sales> findSalesList(PageHelper<Sales> pageHelper) {
        return salesDao.findSalesList(pageHelper);
    }

    /**根据id查找某一条记录*/
    public List<Sales> findSalesId(int id){
        return salesDao.findSalesId(id);
    }

    /**根据客户查找某一条记录*/
    public List<Sales> findSalesName(String salesname){return salesDao.findSalesName(salesname);}

    /**根据销售单号查找某一条记录*/
    public List<Sales> findSalesSalesNumber(int salesnumber){return  salesDao.findSalesSalesNumber(salesnumber);}

    /**
     * 删除销售清单
     */
    public boolean deleteSales(int id){
        return salesDao.deleteSales(id);
    }

    /**
     * 修改销售清单
     */
    public boolean updateSales(Sales sale){
        return salesDao.updateSales(sale);
    }
}
